package com.minimalist.common.entity.basic.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 字典表 实体类。
 *
 * @author 小太阳
 * @since 2024-10-18
 */

@Table(value = "m_dict", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class MDict extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 字典ID
     */
    private Long dictId;

    /**
     * 字典类型
     */
    private String dictType;

    /**
     * 字典key
     */
    private String dictKey;

    /**
     * 字典value
     */
    private String dictValue;

    /**
     * 字典名称
     */
    private String dictName;

    /**
     * 字典描述
     */
    private String dictDesc;

    /**
     * 字典排序值
     */
    private Integer dictOrder;

    /**
     * 字典样式，对应前端Tag组件的type
     */
    private String dictClass;

    /**
     * 状态  0禁用 1正常
     */
    private Integer status;

    public MDict(){
    }

    public MDict(Long dictId, String dictType, String dictKey, String dictValue, String dictName, String dictDesc, Integer dictOrder, String dictClass, Integer status){
        this.dictId = dictId;
        this.dictType = dictType;
        this.dictKey = dictKey;
        this.dictValue = dictValue;
        this.dictName = dictName;
        this.dictDesc = dictDesc;
        this.dictOrder = dictOrder;
        this.dictClass = dictClass;
        this.status = status;
    }

    public Long getDictId(){
        return dictId;
    }

    public void setDictId(Long dictId){
        this.dictId = dictId;
    }

    public String getDictType(){
        return dictType;
    }

    public void setDictType(String dictType){
        this.dictType = dictType;
    }

    public String getDictKey(){
        return dictKey;
    }

    public void setDictKey(String dictKey){
        this.dictKey = dictKey;
    }

    public String getDictValue(){
        return dictValue;
    }

    public void setDictValue(String dictValue){
        this.dictValue = dictValue;
    }

    public String getDictName(){
        return dictName;
    }

    public void setDictName(String dictName){
        this.dictName = dictName;
    }

    public String getDictDesc(){
        return dictDesc;
    }

    public void setDictDesc(String dictDesc){
        this.dictDesc = dictDesc;
    }

    public Integer getDictOrder(){
        return dictOrder;
    }

    public void setDictOrder(Integer dictOrder){
        this.dictOrder = dictOrder;
    }

    public String getDictClass(){
        return dictClass;
    }

    public void setDictClass(String dictClass){
        this.dictClass = dictClass;
    }

    public Integer getStatus(){
        return status;
    }

    public void setStatus(Integer status){
        this.status = status;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }
        MDict mDict = (MDict) o;
        return Objects.equals(dictId, mDict.dictId) &&
                Objects.equals(dictType, mDict.dictType) &&
                Objects.equals(dictKey, mDict.dictKey) &&
                Objects.equals(dictValue, mDict.dictValue) &&
                Objects.equals(dictName, mDict.dictName) &&
                Objects.equals(dictDesc, mDict.dictDesc) &&
                Objects.equals(dictOrder, mDict.dictOrder) &&
                Objects.equals(dictClass, mDict.dictClass) &&
                Objects.equals(status, mDict.status);
    }

    @Override
    public int hashCode(){
        return Objects.hash(super.hashCode(), dictId, dictType, dictKey, dictValue, dictName, dictDesc, dictOrder, dictClass, status);
    }

    @Override
    public String toString(){
        return "MDict{" +
                "dictId=" + dictId +
                ", dictType='" + dictType + '\'' +
                ", dictKey='" + dictKey + '\'' +
                ", dictValue='" + dictValue + '\'' +
                ", dictName='" + dictName + '\'' +
                ", dictDesc='" + dictDesc + '\'' +
                ", dictOrder=" + dictOrder +
                ", dictClass='" + dictClass + '\'' +
                ", status=" + status +
                '}';
    }

    public static MDictBuilder builder(){
        return new MDictBuilder();
    }

    public static class MDictBuilder{
        private Long dictId;
        private String dictType;
        private String dictKey;
        private String dictValue;
        private String dictName;
        private String dictDesc;
        private Integer dictOrder;
        private String dictClass;
        private Integer status;

        MDictBuilder(){
        }

        public MDictBuilder dictId(Long dictId){
            this.dictId = dictId;
            return this;
        }

        public MDictBuilder dictType(String dictType){
            this.dictType = dictType;
            return this;
        }

        public MDictBuilder dictKey(String dictKey){
            this.dictKey = dictKey;
            return this;
        }

        public MDictBuilder dictValue(String dictValue){
            this.dictValue = dictValue;
            return this;
        }

        public MDictBuilder dictName(String dictName){
            this.dictName = dictName;
            return this;
        }

        public MDictBuilder dictDesc(String dictDesc){
            this.dictDesc = dictDesc;
            return this;
        }

        public MDictBuilder dictOrder(Integer dictOrder){
            this.dictOrder = dictOrder;
            return this;
        }

        public MDictBuilder dictClass(String dictClass){
            this.dictClass = dictClass;
            return this;
        }

        public MDictBuilder status(Integer status){
            this.status = status;
            return this;
        }

        public MDict build(){
            return new MDict(dictId, dictType, dictKey, dictValue, dictName, dictDesc, dictOrder, dictClass, status);
        }

        public String toString(){
            return "MDict.MDictBuilder(" +
                    "dictId=" + this.dictId +
                    ", dictType=" + this.dictType +
                    ", dictKey=" + this.dictKey +
                    ", dictValue=" + this.dictValue +
                    ", dictName=" + this.dictName +
                    ", dictDesc=" + this.dictDesc +
                    ", dictOrder=" + this.dictOrder +
                    ", dictClass=" + this.dictClass +
                    ", status=" + this.status +
                    ")";
        }
    }
}
